﻿<%@ Page Title="Manage Faults" Language="C#" MasterPageFile="~/MasterPage.master"
    AutoEventWireup="true" CodeFile="Mng_Faults.aspx.cs" Inherits="admin_Mng_Faults" %>

<asp:Content ID="Head" ContentPlaceHolderID="head" runat="Server">
    <link href="../styles/admin.css" rel="stylesheet" type="text/css" />
</asp:Content>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
     <div id="top_menu">
        <div id="help_button">
            help
        </div>
                                <div id="logout">
            <asp:LoginStatus ID="LoginStatus1" runat="server" LogoutPageUrl="../Default.aspx"
                OnLoggingOut="LoginStatus1_LoggingOut" />
        </div>
    </div>
    <div id="page_title">
        ADMINISTRATION
    </div>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder2" runat="Server">
    <div id="left_content">
        <div class="menu">
            <ul>
                <li><a href="Home.aspx">Home</a></li>
                <li><a href="Mng_Client.aspx">Manage Clients</a></li>
                <li><a href="Mng_Site.aspx">Manage Sites</a></li>
                <li><a href="Mng_Machine.aspx">Manage Machines</a></li>
                <li><a href="Mng_Comp.aspx">Manage Components</a></li>
                <li><a href="Mng_Report.aspx">Manage Reports</a></li>
                <li><a href="Mng_WO.aspx">Manage Work Order</a></li>
                <li><a href="Mng_FaultsRecom.aspx" class="current">Manage Faults</a></li>
            </ul>
        </div>
    </div>
    <!-- end of left content -->
    <div id="right_content">
        <div class="content_area">
            <h2>
                Manage Components
            </h2>
            <div class="form_box1">
                <table>
                    <tr>
                        <td class="Li_buttonC1">
                            <asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl="~/admin/Mng_FaultsRecom.aspx">Faults Recommendation</asp:HyperLink>
                        </td>
                        <td class="Li_buttonC1">
                            <asp:HyperLink ID="HyperLink2" runat="server" NavigateUrl="~/admin/Home.aspx">Return Homepage</asp:HyperLink>
                        </td>
                    </tr>
                </table>
                <asp:GridView ID="GridView1" runat="server" AllowPaging="True" AutoGenerateColumns="False"
                    DataKeyNames="fault_id" OnRowEditing="TaskGridView_RowEditing" PageSize="20"
                    OnPageIndexChanging="PageIndexChanging" OnRowCancelingEdit="TaskGridView_RowCancelingEdit"
                    OnRowUpdating="TaskGridView_RowUpdating" OnRowDeleting="TaskGridView_RowDeleting">
                    <Columns>
                        <asp:TemplateField HeaderText="Component">
                            <ItemTemplate>
                                <%#Eval("Component") %>
                            </ItemTemplate>
                            <EditItemTemplate>
                                <asp:DropDownList runat="server" ID="dropdownlist_component">
                                    <asp:ListItem Text="All Components" Value="1"></asp:ListItem>
                                    <asp:ListItem Text="Motor, Pump, Gearbox, Compressor & Shaft" Value="2"></asp:ListItem>
                                    <asp:ListItem Text="Motor, Pump & Gearbox" Value="3"></asp:ListItem>
                                    <asp:ListItem Text="Pump" Value="4"></asp:ListItem>
                                    <asp:ListItem Text="Motor" Value="5"></asp:ListItem>
                                    <asp:ListItem Text="Shaft" Value="6"></asp:ListItem>
                                    <asp:ListItem Text="Gearbox" Value="7"></asp:ListItem>
                                    <asp:ListItem Text="Blower" Value="8"></asp:ListItem>
                                    <asp:ListItem Text="Compressor" Value="9"></asp:ListItem>
                                </asp:DropDownList>
                            </EditItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="Name" SortExpression="faultName">
                            <ItemTemplate>
                                <asp:Label ID="NameLabel" runat="server" Text='<%# Bind("faultName") %>'></asp:Label>
                            </ItemTemplate>
                            <EditItemTemplate>
                                <asp:TextBox ID="NameTextBox" runat="server" Text='<%# Bind("faultName") %>' Rows="2" Font-Names="Arial"
                                    TextMode="MultiLine" Width="100px"></asp:TextBox>
                            </EditItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="Description" SortExpression="faultDes">
                            <ItemTemplate>
                                <asp:Label ID="faultDesLabel" runat="server" Text='<%# Bind("faultDes") %>'></asp:Label>
                            </ItemTemplate>
                            <EditItemTemplate>
                                <asp:TextBox ID="faultDesTextBox" runat="server" Text='<%# Bind("faultDes") %>'  Rows="5" Font-Names="Arial"
                                    TextMode="MultiLine"></asp:TextBox>
                            </EditItemTemplate>
                        </asp:TemplateField>
                        <asp:BoundField DataField="fault_id" HeaderText="Fault ID" SortExpression="fault_id"
                            InsertVisible="False" />
                        <asp:TemplateField HeaderText="Type" SortExpression="faultType">
                            <ItemTemplate>
                                <asp:Label ID="TypeLabel" runat="server" Text='<%# Bind("faultType") %>'></asp:Label>
                            </ItemTemplate>
                            <EditItemTemplate>
                                <asp:TextBox ID="TypeTextBox" runat="server" Text='<%# Bind("faultType") %>' Width="30px"></asp:TextBox>
                            </EditItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField ShowHeader="False">
                            <ItemTemplate>
                                <asp:LinkButton ID="LinkButton1" runat="server" CausesValidation="False" CommandName="Edit"
                                    Text="Edit"></asp:LinkButton>
                                <br />
                                <asp:LinkButton ID="LinkButton2" runat="server" CausesValidation="False" CommandName="Delete"
                                    Text="Delete"></asp:LinkButton>
                            </ItemTemplate>
                            <EditItemTemplate>
                                <asp:LinkButton ID="LinkButton1" runat="server" CausesValidation="True" CommandName="Update"
                                    Text="Update"></asp:LinkButton>
                                <br />
                                <asp:LinkButton ID="LinkButton2" runat="server" CausesValidation="False" CommandName="Cancel"
                                    Text="Cancel"></asp:LinkButton>
                            </EditItemTemplate>
                        </asp:TemplateField>
                    </Columns>
                    <PagerStyle CssClass="pager" />
                    <HeaderStyle CssClass="header" />
                </asp:GridView>
            </div>
            <div class="form_box2">
                <table>
                    <tr>
                        <td>
                        </td>
                        <td>
                            <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ValidationGroup="addbutton"
                                ControlToValidate="TextBox_faultdes" ErrorMessage="RequiredFieldValidator" CssClass="requiredFieldValidator"></asp:RequiredFieldValidator>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <asp:Label ID="Label1" runat="server" Text="Fault Title: " CssClass="label"></asp:Label>
                        </td>
                        <td>
                            <asp:TextBox ID="TextBox_faulttitle" runat="server" CssClass="fields1"></asp:TextBox>
                        </td>
                    </tr>
                    <tr>
                        <td>
                        </td>
                        <td>
                            <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ValidationGroup="addbutton"
                                ControlToValidate="TextBox_faultdes" ErrorMessage="RequiredFieldValidator" CssClass="requiredFieldValidator"></asp:RequiredFieldValidator>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <asp:Label ID="Label2" runat="server" Text="Fault Description: " CssClass="label"></asp:Label>
                        </td>
                        <td>
                            <asp:TextBox ID="TextBox_faultdes" runat="server" CssClass="fields1" MaxLength="500"
                                Rows="5" TextMode="MultiLine"></asp:TextBox>
                        </td>
                    </tr>
                    <tr>
                        <td colspan="2">
                            <asp:Button ID="AddButton" runat="server" Text="Add" ValidationGroup="addbutton"
                                OnClick="AddButton_Click" CssClass="buttons" />
                        </td>
                    </tr>
                </table>
            </div>
        </div>
    </div>
    <!-- end of right content -->
</asp:Content>
